<template>
  <div class="components-container">
    <div class="header-form">

      <div class="form-group" style="margin-right: 8px;">
        <label for="exampleInputName" class="layui-form-label">逝者姓名</label>
        <input type="text" class="form-control" v-model="selectData.RegnameLike" placeholder="请输入逝者姓名">
      </div>

      <el-button type="primary" @click="btnSearch">搜索</el-button>
      <el-button  @click="btnRepeat" >重置</el-button>
    </div>
    <div style="margin:20px;">
      <ul class="toolList">
        <li v-if="btnShow(item.BTNVALUE)" v-for="(item, index) in $store.state.btnListCommon" @click="operate(item.BTNVALUE)">
          <el-button type="primary" :value="item.BTNSHOWNAME" v-text="item.BTNSHOWNAME"></el-button>
        </li>
      </ul>
    </div>
    <dataTable :headList="headList" :dataList="dataList" :pageOrder="pageOrder" @pageChange="pageChange" @selectRow="selectRow"></dataTable>
    <cresimplereg ref="simpleReg" :orderType="order" @refreshData="getData"></cresimplereg>
  </div>
</template>
<style rel="stylesheet/scss" lang="scss" scoped>

</style>
<script>
import dataTable from "@/components/Table/DataTable";
import apiBase from "@/api/apiBase.js";
import { manage } from "@/mixins/managePage.js";
export default {
  name: "iceregMng",
  mixins: [manage],
  data() {
    return {
      //查询条件
      selectData: {
        RegnameLike: null,
      }
    };
  },
  methods:
  {
      //获取冷藏登记数据
    getData() {
      let selectData = JSON.parse(JSON.stringify(this.selectData));
      let data = {
        PageIndex: this.pageOrder.currentPage,
        PageSize: this.pageOrder.pageSize,
        OrderBy: this.pageOrder.orderType,
        OrderByType: this.pageOrder.orderSort,
        Data: this.$data.selectData,
      };
      apiBase.DoService(
        data,
        apiBase.getApiAdress().Registration.CremationRegistrationQuery,
        res => {
          this.dataList = res.data.content.OutData;
          this.pageOrder.totalNum = res.data.content.RecordCount;
        }
      );
    },
    //获取表头
    getColumns() {
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().Column.GetCremationRegistrationColumns,
        res => {
          this.headList = res.data.content;
        }
      );
    },
  }
};
</script>